<form action="${ctx}/feedBack/handle" method="post" id="handle" enctype="multipart/form-data">
		<input type="hidden" name="problemFeedBackId" value="${feedBackId!}" />
		<input type="hidden" name="problemFeedbackRecordId" value="${feedBackRecordId!}" />
		<div class="form-group form-inline row" >
	        <label class="input_text">标题：</label>
	        <input class="form-control" type="text" value="${wtitle!}" readonly="readonly" />
		</div> 
		<input type="hidden" name="feedBackParentType" value="${feedBack.feedBackParentType!}"/>
		<input type="hidden" name="feedbackType" value="${feedBack.feedbackType!}"/>
		<input type="hidden" name="userType" value="${userType!}"/>
		
		<#if tag != 4>
			<div class="form-group form-inline row">
				<label class="input_text">类型：</label> 
				<select class="form-control" style="width: 200px;" name="feedBackParentTypes" >
					<option value="">请选择</option>
					<#list parentTypeMap as key, value>
						<#if feedBack?? && (feedBack.feedBackParentType == key)>
							<option value="${key}" selected="selected">${value}</option>
							<#else>
							<option value="${key}" >${value}</option>
						</#if>
					</#list>
				</select>
				<select class="form-control" style="width: 200px;" name="feedbackTypes" >
					<option value="">请选择</option>
				</select>
			</div>
		    <div class="form-group form-inline row" >
				<label class="input_text"><span style="color: red">* </span>接收人：</label>
				<#include "../workform/include/receiver.htm">
			</div>
		 </#if>
		 
	     <div class="form-group form-inline row">
			<label class="input_text">参与人：</label>
			<select class="form-control select2" multiple="multiple" data-placeholder="选择参与人" style="width: 600px;" name="participants">
				<option value="">请选择</option>
				<#list participants as p>
					<option value="${p.id}">${p.nickName}</option>
				</#list>
			</select>
		</div> 
		 
		<div class="form-group form-inline row">
           <label class="input_text">备注：</label>
           <textarea class="form-control" rows="3" name="remark" style="width:600px;max-width:600px;max-height: 600px;" maxlength="1000"></textarea>
		</div>
		 <div class="form-group form-inline row">
			 <label for="exampleInputFile" class="input_text">附件：</label>
             <input type="file" name="fileupload" style="display: inline-block;" multiple="multiple" fileMaxSize="1024 * 1024 * 20" 
             	accept=".jpg,.jpeg,.png,.txt,.doc,.docx,.xls,.xlsx"
             	/>
		</div>
</form>
<script type="text/javascript">
	$(function(){
		$.fn.modal.Constructor.prototype.enforceFocus = function() {};
		$('.select2').select2();
	})

  	$("#handle").validate();
	/* 反馈子类型 */
	var subType = {
		<#list subTypeMap as k, v>
			"${k}": "${v}",
		</#list>
	};
	/* 反馈父类型切换 */
	$("select[name='feedBackParentTypes']").change(function() {
		$("select[name='feedbackTypes']").html('<option value="">请选择</option>');
		var parentType = $(this).val();
		$("input[name='feedBackParentType']").val(parentType);
		if (parentType) {
			for (key in subType) {
				if (key.substring(0,key.indexOf('_')) == parentType) {
					$("select[name='feedbackTypes']").append('<option value="' + key + '">' + subType[key] + '</option>');
				}
			}
		}		
	});
	$("select[name='feedbackTypes']").change(function() {
		var feedbackType = $(this).val();
		$("input[name='feedbackType']").val(feedbackType);
	});
	/* 反馈类型汇总 */
	var feedBackMergeType = {
		<#list feedBackMergeTypeMap as k, v>
			"${k}": "${v}",
		</#list>
	};
	/* 设置查询返回类型选中 */
	var feedBackType = "${feedBack.feedbackType!''}";
	if(feedBackType) {
		var parentType = feedBackType.substring(0, feedBackType.indexOf('_'));
		for (key in feedBackMergeType) {
			if (key.startsWith(parentType)) {
				if (key == feedBackType) {
					$("select[name='feedbackTypes']").append('<option value="' + key + '" selected>' + subType[key] + '</option>');
				} else {
					$("select[name='feedbackTypes']").append('<option value="' + key + '">' + subType[key] + '</option>');
				}
			}
		}
	}
</script>
